package transaction.mq.order.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import transaction.mq.order.mq.ChooseCourseTask;
import transaction.mq.order.service.XcOrderService;
@Slf4j
@RestController
@RequestMapping("order")
public class XcOrderController {
    @Autowired
    private XcOrderService xcOrderService;
    @Autowired
    private ChooseCourseTask chooseCourseTask;

    @GetMapping("getAllOrders")
    public Object getAllOrders() {
        log.info("-----------------------获取所有订单接口----------------");
        return xcOrderService.getAllOrders();
    }

    @GetMapping("create")
    public Object create() {
        return xcOrderService.create();
    }

   @GetMapping("test")
    public Object test() {
       chooseCourseTask.sendChooseCourseTask();
       return "ok";
    }


}
